"""
# Author : YuuSoo
# version : python 3.8
# Time : 2023/1/7 11:40
"""
# 程序所用扩展包
import pandas as pd
from py2neo import *
import yaml
import requests
# ==================================================================

# ==================================================================
# import ......
import logging
import flask_restful
# 自定义模块
from errors import my_abort, generate_response, ResponseCode

# 自定义错误
flask_restful.abort = my_abort
root_logger = logging.getLogger('root')
logger = logging.getLogger('main')

# ==================================================================


# ==================================================================
def function(Authorization, fileId,Company,Temperature_num):
    datas = [[]]
    # pklPath = current_app.config['PKL_PATH'] #建议把pklPath作为函数参数传入

    try:  # 简单搞一个粗放型的错误控制，TODO建议predict_*子函数通过抛出自定义异常控制错误代码
        value_qs = function_qs(Authorization, fileId,Company,Temperature_num)
        if value_qs['resp_code'] != 0:
            return value_qs
        datas = value_qs['datas']
        return generate_response(datas)
    except Exception as e:
        return generate_response(datas=datas, code=ResponseCode.ERROR, appendmessage='{0}'.format(str(e)))


def function_qs(Authorization, fileId,Company,Temperature_num):
    res = {}

    logger.info('------------------')
    logger.info('知识库构建开始')
    logger.info('------------------')
    try:
        # model= joblib.load(path_model)
        y_pred = dataProcess(Authorization, fileId,Company,Temperature_num)
        logger.info('知识库构建完成')
        # ......
        return generate_response(y_pred)
    except Exception as e:
        logger.error('知识库构建失败，请检查文件名是否正确')
        res = generate_response(code=ResponseCode.WRONG_PARAM, appendmessage='{0}'.format(str(e)))
    return res


def dataProcess(Authorization, fileId,Company,Temperature_num):
    """设置日志级别"""
    logging.getLogger().setLevel(logging.INFO)

    """读取配置文件，获取配置信息"""
    neo4jurl, username, password, dataBaseName, constructFilePath, url, savePath = readConfig()

    # """下载文件到本地"""
    # fileName = download(Authorization, fileId, url, savePath)

    # constructFilePath = savePath + fileName
    # constructFilePath = r"E:\十所项目\shisuocode\Data\input\1 - 副本.csv"
    #constructFilePath = r"E:\十所项目\shisuocode\Data\input\8_副本.csv"
    constructFilePath = "./Data/input/1.csv"
    # constructFilePath = r"E:\十所项目\shisuocode\Data\input\1.csv"

    constructFilePath2 = "./Data/input/special.csv"


    """连接neo4j数据库"""
    graph = login(neo4jurl, username, password, dataBaseName)

    """创建图谱"""
    createNodeAndRelation(graph,constructFilePath,constructFilePath2,Company,Temperature_num)

    return "构建成功"


def download(Authorization, fileId, url, savePath):
    """
    将文件从minio下载下来
    :param Authorization:
    :param fileId:
    :return:
    """

    headers = {
        'Connection': 'keep-alive',
        'Accept': 'application/json,tex/plain,*/*',
        'X-Requested-with': 'XMLHttpRequest',
        'Authorization': Authorization
    }

    Params = {
        'fileId': fileId
    }

    datas = requests.get(url, headers=headers, params=Params)

    savePath = savePath + fileId + ".csv"

    with open(savePath, "wb") as code:
        code.write(datas.content)

    return fileId + ".csv"


def login(url, username, password, dataBaseName):
    """
    登陆neo4j
    :param username: 用户名
    :param password: 密码
    :param dataBaseName: 要使用的数据库名字
    :return:graph
    """
    # graph = Graph(url, auth=(username, password), name=dataBaseName)
    graph = Graph(url, auth=(username, password))
    logging.info("----------------已经登陆数据库成功，正在进行下一步操作...--------------------")
    return graph


def createNodeAndRelation(graph, printPath,constructFilePath2,Company,Temperature_num):
    """
    创建节点以及节点间关系
    :param graph:
    :param path:
    :return:构建好的知识图谱
    """

    """知识库中有东西的话先全删了"""
    graph.delete_all()
    data_zong = pd.read_csv(printPath)

    """创建图号实体"""
    tuhao_name = Company + Temperature_num
    tuhao_shisuo = Node(tuhao_name)
    graph.create(tuhao_shisuo)

    # for i in data_zong.index:
    for i in data_zong.index:
        # print(i)

        """获取数据"""
        JobName = float(data_zong["装配图号"].values[i])  # 装配图号
        # print(JobName)

        """由于板面分A面B面，故用0代表A面，1代表B面，2代表AB面通用"""
        PCBDeck = data_zong["A面/B面"].values[i]  # PCB板面
        if PCBDeck == "A":
            PCBDeck = 0
        elif PCBDeck == "B":
            PCBDeck = 1
        else:
            PCBDeck = 1

        PCBThickness = float(data_zong["PCB板厚"].values[i])  # PCB板厚
        PCBLength = float(data_zong["PCB板长"].values[i])  # PCB板长
        PCBWidth = float(data_zong["PCB板宽"].values[i]) # PCB板宽

        """由于该字段为有无，所以0代表无，1代表有"""
        Special_Dev = data_zong["有无特殊温度要求器件"].values[i]  # 有无特殊温度要求器件
        if Special_Dev == "无":
            Special_Dev = 0
        else:
            Special_Dev = 1

        """以下为印刷工艺参数"""
        BladeLength = float(data_zong["刮刀长度"].values[i]) if "刮刀长度" in data_zong else None  # 刮刀长度
        BladePressure = float(data_zong["刮刀压力"].values[i]) if "刮刀压力" in data_zong else None  # 刮刀压力
        PrintSpeed = float(data_zong["印刷速度"].values[i]) if "印刷速度" in data_zong else None  # 印刷速度
        DemSpeed = float(data_zong["脱模速度"].values[i]) if "脱模速度" in data_zong else None  # 脱模速度

        """以下为焊接工艺参数"""
        Warm_zone1 = float(data_zong["温区一温度"].values[i]) if "温区一温度" in data_zong else None  # 温区一温度
        Warm_zone2 = float(data_zong["温区二温度"].values[i]) if "温区二温度" in data_zong else None  # 温区二温度
        Warm_zone3 = float(data_zong["温区三温度"].values[i]) if "温区三温度" in data_zong else None  # 温区三温度
        Warm_zone4 = float(data_zong["温区四温度"].values[i]) if "温区四温度" in data_zong else None  # 温区四温度
        Warm_zone5 = float(data_zong["温区五温度"].values[i]) if "温区五温度" in data_zong else None  # 温区五温度
        Warm_zone6 = float(data_zong["温区六温度"].values[i]) if "温区六温度" in data_zong else None  # 温区六温度
        Warm_zone7 = float(data_zong["温区七温度"].values[i]) if "温区七温度" in data_zong else None  # 温区七温度
        Warm_zone8 = float(data_zong["温区八温度"].values[i]) if "温区八温度" in data_zong else None  # 温区八温度
        Warm_zone9 = float(data_zong["温区九温度"].values[i]) if "温区九温度" in data_zong else None  # 温区九温度
        Warm_zone10 = float(data_zong["温区十温度"].values[i]) if "温区十温度" in data_zong else None  # 温区十温度
        With_speed = float(data_zong["带速"].values[i]) if "带速" in data_zong else None  # 带速
        N2_Con = float(data_zong["氧气浓度"].values[i]) if "氧气浓度" in data_zong else None  # 氮气浓度
        UpJiaRePower = float(data_zong["上加热器功率"].values[i]) if "上加热器功率" in data_zong else None  # 上加热器功率
        coolerPower = float(data_zong["冷却器功率"].values[i]) if "冷却器功率" in data_zong else None  # 冷却器功率
        DownJiaRePower = float(data_zong["下加热器功率"].values[i]) if "下加热器功率" in data_zong else None  # 下加热器功率

        """创建节点"""
        node_JobName = Node("装配图号", name=JobName, PCBDeck=PCBDeck, PCBThickness=PCBThickness, PCBLength=PCBLength,
                            PCBWidth=PCBWidth, Special_Dev=Special_Dev)
        node_print = Node("工艺", name="印刷工艺")
        node_weld = Node("工艺", name="回流焊接工艺")
        node_BladeLength = Node("工艺参数", name="刮刀长度", BladeLength=BladeLength)
        node_BladePressure = Node("工艺参数", name="刮刀压力", BladePressure=BladePressure)
        node_PrintSpeed = Node("工艺参数", name="印刷速度", PrintSpeed=PrintSpeed)
        node_DemSpeed = Node("工艺参数", name="脱模速度", DemSpeed=DemSpeed)
        node_Warm_zone1 = Node("工艺参数", name="温区一温度", Warm_zone1=Warm_zone1)
        node_Warm_zone2 = Node("工艺参数", name="温区二温度", Warm_zone2=Warm_zone2)
        node_Warm_zone3 = Node("工艺参数", name="温区三温度", Warm_zone3=Warm_zone3)
        node_Warm_zone4 = Node("工艺参数", name="温区四温度", Warm_zone4=Warm_zone4)
        node_Warm_zone5 = Node("工艺参数", name="温区五温度", Warm_zone5=Warm_zone5)
        node_Warm_zone6 = Node("工艺参数", name="温区六温度", Warm_zone6=Warm_zone6)
        node_Warm_zone7 = Node("工艺参数", name="温区七温度", Warm_zone7=Warm_zone7)
        node_Warm_zone8 = Node("工艺参数", name="温区八温度", Warm_zone8=Warm_zone8)
        node_Warm_zone9 = Node("工艺参数", name="温区九温度", Warm_zone9=Warm_zone9)
        node_Warm_zone10 = Node("工艺参数", name="温区十温度", Warm_zone10=Warm_zone10)

        node_With_speed = Node("工艺参数", name="带速", With_speed=With_speed)
        node_N2_Con = Node("工艺参数", name="氧气浓度", N2_Con=N2_Con)
        node_UpJiaRePower = Node("工艺参数", name="上加热器功率", UpJiaRePower=UpJiaRePower)
        node_coolerPower = Node("工艺参数", name="冷却器功率", coolerPower=coolerPower)
        node_DownJiaRePower = Node("工艺参数", name="下加热器功率", DownJiaRePower=DownJiaRePower)

        """创建实体"""
        graph.create(node_JobName)
        graph.create(node_print)
        graph.create(node_weld)
        graph.create(node_BladeLength)
        graph.create(node_BladePressure)
        graph.create(node_PrintSpeed)
        graph.create(node_DemSpeed)
        graph.create(node_Warm_zone1)
        graph.create(node_Warm_zone2)
        graph.create(node_Warm_zone3)
        graph.create(node_Warm_zone4)
        graph.create(node_Warm_zone5)
        graph.create(node_Warm_zone6)
        graph.create(node_Warm_zone7)
        graph.create(node_Warm_zone8)
        graph.create(node_Warm_zone9)
        graph.create(node_Warm_zone10)

        graph.create(node_With_speed)
        graph.create(node_N2_Con)
        graph.create(node_UpJiaRePower)
        graph.create(node_coolerPower)
        graph.create(node_DownJiaRePower)

        """输出日志信息"""
        # logging.info("------------------创建实体成功...-------------------")

        """建立实体关系"""
        tuhao_Relationship_node_JobName = Relationship(tuhao_shisuo, "include", node_JobName)
        node_JobName_Relationship_node_print = Relationship(node_JobName, "effect", node_print)
        node_JobName_Relationship_node_weld = Relationship(node_JobName, "effect", node_weld)
        # 以下是印刷参数的关系
        node_print_Relationship_node_BladeLength = Relationship(node_print, "include", node_BladeLength)
        node_print_Relationship_node_BladePressure = Relationship(node_print, "include", node_BladePressure)
        node_print_Relationship_node_PrintSpeed = Relationship(node_print, "include", node_PrintSpeed)
        node_print_Relationship_node_DemSpeed = Relationship(node_print, "include", node_DemSpeed)
        # 以下是焊接参数之间的关系
        node_weld_Relationship_node_Warm_zone1 = Relationship(node_weld, "include", node_Warm_zone1)
        node_weld_Relationship_node_Warm_zone2 = Relationship(node_weld, "include", node_Warm_zone2)
        node_weld_Relationship_node_Warm_zone3 = Relationship(node_weld, "include", node_Warm_zone3)
        node_weld_Relationship_node_Warm_zone4 = Relationship(node_weld, "include", node_Warm_zone4)
        node_weld_Relationship_node_Warm_zone5 = Relationship(node_weld, "include", node_Warm_zone5)
        node_weld_Relationship_node_Warm_zone6 = Relationship(node_weld, "include", node_Warm_zone6)
        node_weld_Relationship_node_Warm_zone7 = Relationship(node_weld, "include", node_Warm_zone7)
        node_weld_Relationship_node_Warm_zone8 = Relationship(node_weld, "include", node_Warm_zone8)
        node_weld_Relationship_node_Warm_zone9 = Relationship(node_weld, "include", node_Warm_zone9)
        node_weld_Relationship_node_Warm_zone10 = Relationship(node_weld, "include", node_Warm_zone10)

        node_weld_Relationship_node_With_speed = Relationship(node_weld, "include", node_With_speed)
        node_weld_Relationship_node_N2_Con = Relationship(node_weld, "include", node_N2_Con)
        node_weld_Relationship_node_UpJiaRePower = Relationship(node_weld, "include", node_UpJiaRePower)
        node_weld_Relationship_node_coolerPower = Relationship(node_weld, "include", node_coolerPower)
        node_weld_Relationship_node_DownJiaRePower = Relationship(node_weld, "include", node_DownJiaRePower)

        """创建实体关系"""
        graph.create(tuhao_Relationship_node_JobName)
        graph.create(node_JobName_Relationship_node_print)
        graph.create(node_JobName_Relationship_node_weld)
        # 以下是创建印刷之间的
        graph.create(node_print_Relationship_node_BladeLength)
        graph.create(node_print_Relationship_node_BladePressure)
        graph.create(node_print_Relationship_node_PrintSpeed)
        graph.create(node_print_Relationship_node_DemSpeed)
        # 以下是创建焊接之间的
        graph.create(node_weld_Relationship_node_Warm_zone1)
        graph.create(node_weld_Relationship_node_Warm_zone2)
        graph.create(node_weld_Relationship_node_Warm_zone3)
        graph.create(node_weld_Relationship_node_Warm_zone4)
        graph.create(node_weld_Relationship_node_Warm_zone5)
        graph.create(node_weld_Relationship_node_Warm_zone6)
        graph.create(node_weld_Relationship_node_Warm_zone7)
        graph.create(node_weld_Relationship_node_Warm_zone8)
        graph.create(node_weld_Relationship_node_Warm_zone9)
        graph.create(node_weld_Relationship_node_Warm_zone10)

        graph.create(node_weld_Relationship_node_With_speed)
        graph.create(node_weld_Relationship_node_N2_Con)
        graph.create(node_weld_Relationship_node_UpJiaRePower)
        graph.create(node_weld_Relationship_node_coolerPower)
        graph.create(node_weld_Relationship_node_DownJiaRePower)

        """打出日志信息"""
        logging.info("----------------创建实体1关系成功...----------------")


    data_biaozhun = pd.read_csv(constructFilePath2)

    tuhao_name_1 = "标准温度曲线"
    tuhao_biaozhun = Node(tuhao_name_1)
    graph.create(tuhao_biaozhun)

    # for i in data_zong.index:
    for i in data_biaozhun.index:
        """获取数据"""
        JobName_1 =float(data_biaozhun["序号"].values[i])   # 装配图号

        """有无BGA"""
        BGA_status = data_biaozhun["有无BGA"].values[i]  # BGA
        if BGA_status == "无":
            BGA_status = 0
        elif BGA_status == "有":
            BGA_status = 1
        else:
            BGA_status = 0


        PCBThickness_1 = float(data_biaozhun["板厚"].values[i])
        Temperature = float(data_biaozhun["特殊温度"].values[i])

        """以下为焊接工艺参数"""
        Warm_zone1_1 = float(data_biaozhun["1"].values[i]) if "1" in data_biaozhun else None  # 温区一温度
        Warm_zone2_1 = float(data_biaozhun["2"].values[i]) if "2" in data_biaozhun else None  # 温区二温度
        Warm_zone3_1 = float(data_biaozhun["3"].values[i]) if "3" in data_biaozhun else None  # 温区三温度
        Warm_zone4_1 = float(data_biaozhun["4"].values[i]) if "4" in data_biaozhun else None  # 温区四温度
        Warm_zone5_1 = float(data_biaozhun["5"].values[i]) if "5" in data_biaozhun else None  # 温区五温度
        Warm_zone6_1 = float(data_biaozhun["6"].values[i]) if "6" in data_biaozhun else None  # 温区六温度
        Warm_zone7_1 = float(data_biaozhun["7"].values[i]) if "7" in data_biaozhun else None  # 温区七温度
        Warm_zone8_1 = float(data_biaozhun["8"].values[i]) if "8" in data_biaozhun else None  # 温区八温度
        Warm_zone9_1 = float(data_biaozhun["9"].values[i]) if "9" in data_biaozhun else None  # 温区九温度
        Warm_zone10_1 = float(data_biaozhun["10"].values[i]) if "10" in data_biaozhun else None  # 温区十温度
        With_speed_1 = float(data_biaozhun["带速"].values[i]) if "带速" in data_biaozhun else None  # 带速
        N2_Con_1 = float(data_biaozhun["氧气浓度"].values[i]) if "氧气浓度" in data_biaozhun else None  # 氮气浓度
        UpJiaRePower_1 = float(data_biaozhun["上加热器功率"].values[i]) if "上加热器功率" in data_biaozhun else None  # 上加热器功率
        coolerPower_1 = float(data_biaozhun["冷却器功率"].values[i]) if "冷却器功率" in data_biaozhun else None  # 冷却器功率
        DownJiaRePower_1 = float(data_biaozhun["下加热器功率"].values[i]) if "下加热器功率" in data_biaozhun else None  # 下加热器功率
        print(type(Warm_zone1_1))


        """创建节点"""
        node_JobName_1 = Node("序号_1", name=JobName_1, PCBThickness=PCBThickness_1,BGA_status=BGA_status, Temperature=Temperature)
        node_weld_1 = Node("工艺_1", name="回流焊接工艺")
        node_Warm_zone1_1 = Node("工艺参数_1", name="温区1", Warm_zone1_1=Warm_zone1_1)
        node_Warm_zone2_1 = Node("工艺参数_1", name="温区2", Warm_zone2_1=Warm_zone2_1)
        node_Warm_zone3_1 = Node("工艺参数_1", name="温区3", Warm_zone3_1=Warm_zone3_1)
        node_Warm_zone4_1 = Node("工艺参数_1", name="温区4", Warm_zone4_1=Warm_zone4_1)
        node_Warm_zone5_1 = Node("工艺参数_1", name="温区5", Warm_zone5_1=Warm_zone5_1)
        node_Warm_zone6_1 = Node("工艺参数_1", name="温区6", Warm_zone6_1=Warm_zone6_1)
        node_Warm_zone7_1 = Node("工艺参数_1", name="温区7", Warm_zone7_1=Warm_zone7_1)
        node_Warm_zone8_1 = Node("工艺参数_1", name="温区8", Warm_zone8_1=Warm_zone8_1)
        node_Warm_zone9_1 = Node("工艺参数_1", name="温区9", Warm_zone9_1=Warm_zone9_1)
        node_Warm_zone10_1 = Node("工艺参数_1", name="温区10", Warm_zone10_1=Warm_zone10_1)
        node_With_speed_1 = Node("工艺参数_1", name="带速", With_speed_1=With_speed_1)
        node_N2_Con_1 = Node("工艺参数_1", name="氧气浓度", N2_Con_1=N2_Con_1)
        node_UpJiaRePower_1 = Node("工艺参数_1", name="上加热器功率", UpJiaRePower_1=UpJiaRePower_1)
        node_coolerPower_1 = Node("工艺参数_1", name="冷却器功率", coolerPower_1=coolerPower_1)
        node_DownJiaRePower_1 = Node("工艺参数_1", name="下加热器功率", DownJiaRePowe_1=DownJiaRePower_1)
        # print(node_Warm_zone1_1)
        logging.info("----------------创建实体1关系成功...----------------")
        """创建实体"""
        graph.create(node_JobName_1)
        graph.create(node_weld_1)
        graph.create(node_Warm_zone1_1)
        graph.create(node_Warm_zone2_1)
        graph.create(node_Warm_zone3_1)
        graph.create(node_Warm_zone4_1)
        graph.create(node_Warm_zone5_1)
        graph.create(node_Warm_zone6_1)
        graph.create(node_Warm_zone7_1)
        graph.create(node_Warm_zone8_1)
        graph.create(node_Warm_zone9_1)
        graph.create(node_Warm_zone10_1)
        graph.create(node_With_speed_1)
        graph.create(node_N2_Con_1)
        graph.create(node_UpJiaRePower_1)
        graph.create(node_coolerPower_1)
        graph.create(node_DownJiaRePower_1)
        """输出日志信息"""


        logging.info("------------------创建实体成功...-------------------")

        """建立实体关系"""
        tuhao_Relationship_node_JobName_1 = Relationship(tuhao_biaozhun, "include", node_JobName_1)

        node_JobName_Relationship_node_weld_1 = Relationship(node_JobName_1, "effect", node_weld_1)

        # 以下是焊接参数之间的关系
        node_weld_Relationship_node_Warm_zone1_1 = Relationship(node_weld_1, "include", node_Warm_zone1_1)
        node_weld_Relationship_node_Warm_zone2_1 = Relationship(node_weld_1, "include", node_Warm_zone2_1)
        node_weld_Relationship_node_Warm_zone3_1 = Relationship(node_weld_1, "include", node_Warm_zone3_1)
        node_weld_Relationship_node_Warm_zone4_1 = Relationship(node_weld_1, "include", node_Warm_zone4_1)
        node_weld_Relationship_node_Warm_zone5_1 = Relationship(node_weld_1, "include", node_Warm_zone5_1)
        node_weld_Relationship_node_Warm_zone6_1 = Relationship(node_weld_1, "include", node_Warm_zone6_1)
        node_weld_Relationship_node_Warm_zone7_1 = Relationship(node_weld_1, "include", node_Warm_zone7_1)
        node_weld_Relationship_node_Warm_zone8_1 = Relationship(node_weld_1, "include", node_Warm_zone8_1)
        node_weld_Relationship_node_Warm_zone9_1 = Relationship(node_weld_1, "include", node_Warm_zone9_1)
        node_weld_Relationship_node_Warm_zone10_1 = Relationship(node_weld_1, "include", node_Warm_zone10_1)
        node_weld_Relationship_node_With_speed_1 = Relationship(node_weld_1, "include", node_With_speed_1)
        node_weld_Relationship_node_N2_Con_1 = Relationship(node_weld_1, "include", node_N2_Con_1)
        node_weld_Relationship_node_UpJiaRePower_1 = Relationship(node_weld_1, "include", node_UpJiaRePower_1)
        node_weld_Relationship_node_coolerPower_1 = Relationship(node_weld_1, "include", node_coolerPower_1)
        node_weld_Relationship_node_DownJiaRePower_1 = Relationship(node_weld_1, "include", node_DownJiaRePower_1)

        """创建实体关系"""
        graph.create(tuhao_Relationship_node_JobName_1)
        graph.create(node_JobName_Relationship_node_weld_1)
        # 以下是创建焊接之间的
        graph.create(node_weld_Relationship_node_Warm_zone1_1)
        graph.create(node_weld_Relationship_node_Warm_zone2_1)
        graph.create(node_weld_Relationship_node_Warm_zone3_1)
        graph.create(node_weld_Relationship_node_Warm_zone4_1)
        graph.create(node_weld_Relationship_node_Warm_zone5_1)
        graph.create(node_weld_Relationship_node_Warm_zone6_1)
        graph.create(node_weld_Relationship_node_Warm_zone7_1)
        graph.create(node_weld_Relationship_node_Warm_zone8_1)
        graph.create(node_weld_Relationship_node_Warm_zone9_1)
        graph.create(node_weld_Relationship_node_Warm_zone10_1)
        graph.create(node_weld_Relationship_node_With_speed_1)
        graph.create(node_weld_Relationship_node_N2_Con_1)
        graph.create(node_weld_Relationship_node_UpJiaRePower_1)
        graph.create(node_weld_Relationship_node_coolerPower_1)
        graph.create(node_weld_Relationship_node_DownJiaRePower_1)
        """打出日志信息"""
        logging.info("----------------创建实体2关系成功...----------------")

        logging.info("=====================知识库构建完成=========================")


def readConfig():
    """
    读取配置文件
    :return:
    """
    with open('./conf/application.yml', 'r', encoding='utf-8') as f:
        file_content = f.read()
        content = yaml.load(file_content, yaml.FullLoader)
        neo4jurl = content["neo4j"]["url"]  # 连接地址
        username = content["neo4j"]["username"]  # 用户名
        password = content["neo4j"]["password"]  # 密码
        dataBaseName = content["neo4j"]["dataBaseName"]  # 数据库名
        constructFilePath = content["neo4j"]["construct"]["constructFilePath"]
        url = content["fileUploadDownload"]["download"]["url"]
        savePath = content["fileUploadDownload"]["download"]["savePath"]
        # 输出日志信息
        logging.info(constructFilePath)
        logging.info("----------------读取配置文件成功......--------------------")
        return neo4jurl, username, password, dataBaseName, constructFilePath, url, savePath
